package com.veryUsedCar.controller;

import com.veryUsedCar.data.Result;
import com.veryUsedCar.entity.Charnnel;
import com.veryUsedCar.service.CharnnelService;
import io.swagger.annotations.Api;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("charnnel")
@Slf4j
@Api("首页导航栏接口")
@RefreshScope //配置刷新
public class CharnnelController {
    @Autowired
    private CharnnelService charnnelService;

    @GetMapping
    @ApiOperation(value = "导航栏查询")
    public Result findCharnnel() {
        List<Charnnel> list = charnnelService.findCharnnel();
        return Result.OK().setData(list);
    }

}
